import request from 'umi-request';

export async function queryProfessionList(params = {}) {
  return request('/hr-ssc/api/api-admin/promotion/getPromotionList', {
    method: 'post',
    data: {
      pageNum: params.current,
      pageSize: params.pageSize,
      promotionKind : 0,
      promotionType :1,
      userCode:params.code,
      name:params.name,
      isSelf:0
    },
  }).then((res) => {
    const data = res.data;
    return {
      current: data.currPage,
      data: data.list,
      pageSize: data.pageSize,
      success: true,
      total: data.totalCount,
    };
  });
}

export async function saveManagesInfo(params) {
  return request('/hr-ssc/api/api-admin/promotion/doBatchPromotion', {
    method: 'POST',
    data: params,
  });
}

export async function getDepartmentUser(orgId) {
  return request(`/hr-ssc/api/api-admin/roleAssignment/getDepartmentUser?orgId=${orgId}`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}
